<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>padding</title>
    <style>
        div {
            width: 50px;
            height: 50px;
            border: 1px solid red;
        }
        div:first-child {
            margin-bottom: 50px;
        }
        div:last-child {
            margin-top: 500000px;
            /* 用padding解决上下间隔的问题 */
        }
    </style>
</head>
<body>
    <!-- 2个上下的div元素一个设置margin-bottom另一个设置margin-top,会产生有交集的地方,上面的maring生效,下面的不生效 -->
    <div class="box1">box 1</div>
    <div class="box2">box 2</div>
</body>
</html>